package com.htfyun.factorytest.common;

import android.util.Log;

import com.htfyun.factorytest.utils.ShellUtils;
import com.htfyun.factorytest.utils.ShellUtils.CommandResult;

public class RecordUtils {
    private final static String TAG = RecordUtils.class.getSimpleName();

    private static final String[] REGISTER_NAMES = {"1b", "1c", "1d", "1e"};
    private static final String REGISTER_PATH = " > /sys/class/htfyun-es7210/reg";

    public static void setRegister(String name, String value) {
        CommandResult commandResult =
                ShellUtils.execCommand("echo " + name + " " + value + REGISTER_PATH, false);
        Log.d(TAG, "CommandResult = " + commandResult.toString());

    }

    public static void setAllRegister(String value) {
        for (String name : REGISTER_NAMES) {
            CommandResult commandResult =
                    ShellUtils.execCommand("echo " + name + " " + value + REGISTER_PATH, false);
            Log.d(TAG, "CommandResult = " + commandResult.toString());
        }
    }

}
